home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / asm / pc370_3.exe / lha / DAT.ALC < prev    next >
Text File  |  1986-07-22  |  2KB  |  85 lines

  1.     TITLE 'DAT - DATE AND TIME SUBROUTINE'
  2. *
  3. *  AUTHOR.    DON HIGGINS.
  4. *  DATE.      04/01/85.
  5. *  REMARKS.
  6. *
  7. *  THIS SUBROUTINE PRINTS DATE AND TIME ON STD. OUTPUT DEVICE.
  8. *  THE DATE AND TIME IS OBTAINED FROM MSDOS.
  9. *
  10. *  REGISTER USAGE.
  11. *
  12. *    0 - WORK
  13. *    1 - WORK
  14. *    2 - WORK
  15. *   14 - RETURN ADDRESS (USUALLY SET BY BALR 14,15)
  16. *   15 - ENTRY POINT
  17. *
  18. DAT      CSECT
  19.     USING *,R15
  20.     SVC   TIMER
  21.     CVD   R1,PWORK                 YEAR
  22.     MVC   DYEAR,=X'402020202020'
  23.     ED    DYEAR,PWORK+5
  24.     ST    R0,WORK
  25.     SR    R0,R0
  26.     IC    R0,WORK                  HOURS
  27.     BAL   R1,CVT
  28.     MVC   DHH,DWORK+2
  29.     IC    R0,WORK+1                MINUTES
  30.     BAL   R1,CVT
  31.     MVC   DMM,DWORK+2
  32.     IC    R0,WORK+2                SECONDS
  33.     BAL   R1,CVT
  34.     MVC   DSS,DWORK+2
  35.     IC    R0,WORK+3                100TH SECONDS
  36.     BAL   R1,CVT
  37.     MVC   DTH,DWORK+2
  38.     ST    R2,WORK
  39.     IC    R0,WORK                  MONTH
  40.     LR    R1,R0
  41.     MH    R1,=H'3'
  42.     LA    R1,MMTAB-3(R1)
  43.     MVC   MONTH,0(R1)
  44.     IC    R0,WORK+1                DAY
  45.     MVI   MASK+1,X'20'                   SET ZERO SURPRESS
  46.     BAL   R1,CVT
  47.     MVI   MASK+1,X'21'                   RESET
  48.     MVC   DDD,DWORK+2
  49.     IC    R0,WORK+2                DAY OF WEEK
  50.     LR    R1,R0
  51.     MH    R1,=H'3'
  52.     LA    R1,DOWTAB(R1)
  53.     MVC   DAY,0(R1)
  54.     LA    R2,TODMSG
  55.     SVC   WTO                     PRINT DATE AND TIME
  56.     BR    R14
  57. CVT      EQU   *                       CONVERT BINARY TO DECIMAL
  58.     CVD   R0,PWORK
  59.     MVC   DWORK,MASK
  60.     ED    DWORK,PWORK+6
  61.     BR    R1
  62. TIMER    EQU   18    SVC FOR TIME AND DATE
  63. WTO      EQU   209   SVC FOR WRITE TO OPERATOR
  64. R15      EQU   15
  65. R14      EQU   14
  66. R0       EQU   0
  67. R1       EQU   1
  68. R2       EQU   2
  69. TODMSG   DC    C' DATE = '
  70. DAY      DC    C'XXX',C' '
  71. MONTH    DC    C'XXX',C' '
  72. DDD      DC    C'ZZ',C','
  73. DYEAR    DC    C' ZZZZZ',C'  TIME = '
  74. DHH      DC    C'ZZ',C':'
  75. DMM      DC    C'ZZ',C':'
  76. DSS      DC    C'ZZ',C':'
  77. DTH      DC    C'ZZ',C'$'
  78. DOWTAB   DC    C'SUNMONTUEWEDTHUFRISAT'
  79. MMTAB    DC    C'JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC'
  80. WORK     DC    F'0'
  81. PWORK    DC    D'0'
  82. DWORK    DC    C' Z99'
  83. MASK     DC    X'40212020'
  84.     END
  85.